import request from '@/api'

export function getCompanyApi() {
  // 获取公司
  return request.get(`/dataApi/sys/getCompany`)
}

export function getCurrentMenuApi() {
  // 获取菜单
  return request.get(`/dataApi/sys/roleOrMenuTreeList/menu`)
}
export function selectPersonApi() {
  // 获取人员树
  return request.post(`/dataApi/sys/getPersonByName`, { name: '' })
}
// 已弃用
export function selectPersonApiOld() {
  // 获取人员树
  return request.post(`/dataApi/sys/selectPerson`, { name: '' })
}

export function deleteRoleApi(roleId) {
  // 删除角色
  return request.delete(`/dataApi/role/deleteRole/${roleId}`)
}

export function addRole(map) {
  // 添加角色
  return request.post(`/dataApi/role/addRole`, map)
}

export function updateRole(map) {
  // 修改角色
  return request.post(`/dataApi/role/updateRole`, map)
}

export function getCurrentRoleDetailApi(roleId) {
  // 角色详情
  return request.get(`/dataApi/role/getCurrentRoleDetail/${roleId}`)
}
export function getPersonList() {
  // 获取人员列表
  return request.post(`/dataApi/user/getPersonList`, {
    pageNum: 1,
    pageSize: 10000
  })
}
